home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10136 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.netam.net!alpha!bgc
  2. From: bgc@alpha.netam.net (The Bowling Green Connection)
  3. Newsgroups: comp.lang.c
  4. Subject: Help! Good methods for locking files?
  5. Date: 15 Mar 1996 19:22:45 GMT
  6. Organization: NetAmerica, Bowling Green, KY.
  7. Message-ID: <4icg25$csg@news.netam.net>
  8. NNTP-Posting-Host: alpha.netam.net
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Here is the situation:
  12. I am writing a cgi program for the internet in C.  When a web surfer clicks
  13. a SUBMIT button, the information he typed on the screen will be sent
  14. to a FILE, and that file will be MAILED off with a system() procedure
  15. that calls a Unix mailto command.
  16.  
  17. The problem is that two or more web surfers could click a SUBMIT button
  18. at the same time, which would cause mayhem if not for file locking.
  19.  
  20. How can I ensure that 1) The file (which always has the same name) is
  21. not overwritten by a simultaneous click, and 2) that the file is not
  22. overwritten before the mailto command gets finished mailing it off?
  23.  
  24. Help would be greatly appreciated!
  25. _______________________________________________________________________________
  26. Edgar E. Easterly, IV   (bgc@bgcky.com)   Bowling Green, Kentucky         -=O=-
  27. "Except the Lord build thy house, ye labour in vain that build it; Except   *
  28. the Lord keep thy city, the watchman will awake but in vain." Psalms 127:1  |
  29.